#!/bin/bash
# cuda=7
# trainer=new_fine_brats_epoch500_06
# task=Task607_CZ2
#
# CUDA_DEVICE_ORDER=PCI_BUS_ID \
# CUDA_VISIBLE_DEVICES=${cuda} \
# nnUNet_train \
# 3d_fullres \
# ${trainer} \
# ${task} \
# 0 \
# --npz \
# --fp32


nnUNet_dataset=/home/yusongli/Templates/yunet
export nnUNet_raw_data_base="${nnUNet_dataset}/nnUNet_raw"
export nnUNet_preprocessed="${nnUNet_dataset}/nnUNet_preprocessed"
export RESULTS_FOLDER="${nnUNet_dataset}/nnUNet_results"
export CUDA_DEVICE_ORDER=PCI_BUS_ID


TASK=002


function preprocess () {
    nnUNet_plan_and_preprocess -t "${TASK}"
}


function train () {
    CUDA=0
    FOLD=0
    TRAINER=nnUNetTrainerV2_yusongli

    CUDA_VISIBLE_DEVICES=${CUDA} \
    nnUNet_train \
        3d_fullres \
        "${TRAINER}" \
        "${TASK}" \
        "${FOLD}" \
        --npz
        # --fp32
}


function main () {
    # preprocess

    # FOLDS=(0 1 2 3 4)
    # for i in ${FOLDS[@]}; do
    #     train "${i}"
    # done

    train
}


main
